package com.google.code.jmarias.client;

import com.google.code.jmarias.client.states.MainMenuState;
import com.google.code.jmarias.client.states.GameState;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;


public class Demo extends StateBasedGame { 

    private static final String GAMETITLE = "p\u0159\u00edli\u0161";
    private static AppGameContainer app;


    private static Globals global = null;

    public Demo() throws SlickException {
        super(GAMETITLE); 

        global = new Globals();

        this.addState(new MainMenuState(global.getMAINMENUSTATE(), global));
        this.addState(new GameState(global.getGAMESTATE(), global));
        this.enterState(global.getMAINMENUSTATE());

    }

    public static void main(String [] args) throws SlickException {
        app = new AppGameContainer(new Demo());

        System.out.println("Příliš žluťoučký kůň úpěnlivě pěl ďábelské ódy");

        app.setDisplayMode(global.getScreenWidth(),global.getScreenHeight(), global.isFullscreen());
        app.setShowFPS(false);
        app.start();

   }

   public void setApp() {
       
   }

    public void initStatesList(GameContainer gameContainer) throws SlickException {
        global.loadFonts();

        this.getState(global.getMAINMENUSTATE()).init(gameContainer,this);
//        this.getState(GAMESTATE).init(gameContainer,this);

    }



}